Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: move progress related apis permissions to standard permission file #51

Open
wants to merge 1 commit into
base: open-release/palm.nelp
Choose a base branch
from

Conversation

tehreem-sadat
Copy link
Collaborator

@tehreem-sadat tehreem-sadat commented Jan 1, 2025

Description

feat: move progress related apis permissions to standard permission file so it can be override for data researchers.

Supporting information

Related Issue: feat: Data Researcher to have access on course progress page of Students

@tehreem-sadat tehreem-sadat changed the title feat: move progress related apis permissions to standard permission f… feat: move progress related apis permissions to standard permission file Jan 2, 2025
@tehreem-sadat tehreem-sadat force-pushed the tehreem/move_permissions_to_std_permissions_file branch 10 times, most recently from e32e53c to 6c012fc Compare January 7, 2025 11:12
Copy link
Collaborator

@OmarIthawi OmarIthawi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @tehreem-sadat. Do we have existing test case to cover this behaviour? If not, we should add at least one test case.

Other than that, the code looks clean and it looks great.

@tehreem-sadat
Copy link
Collaborator Author

tehreem-sadat commented Jan 7, 2025

There are already detailed tests covering both API's. In this PR we didn't change any behaviour just did some restructuring so I don't think any new tests are required.

Copy link
Collaborator

@shadinaif shadinaif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks great, thank you @tehreem-sadat ! I'm marking it as request changes to avoid merging until I test it in my local with all possible scenarios I can think of

@@ -186,8 +187,9 @@ def get(self, request, *args, **kwargs):
monitoring_utils.set_custom_attribute('user_id', request.user.id)
monitoring_utils.set_custom_attribute('is_staff', request.user.is_staff)
is_staff = bool(has_access(request.user, 'staff', course_key))
can_masquarade = request.user.has_perm(permissions.CAN_MASQUARADE_LEARNER_PROGRESS, course_key)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meanwhile @tehreem-sadat , please try to add a test that checks the flow when permissions.CAN_MASQUARADE_LEARNER_PROGRESS returns True and False

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yess, that can be added, thanks.

@tehreem-sadat tehreem-sadat force-pushed the tehreem/move_permissions_to_std_permissions_file branch 4 times, most recently from 900fafd to 2b1034a Compare January 8, 2025 10:31
@shadinaif
Copy link
Collaborator

Note: we'll most likely wait for redwood release then merge this into redwood.nelp branch. But it's great to see it working on staging

@shadinaif
Copy link
Collaborator

testing on staging: https://github.com/nelc/edx-platform-strains/pull/325

@tehreem-sadat tehreem-sadat force-pushed the tehreem/move_permissions_to_std_permissions_file branch from 2b1034a to e7af2f0 Compare January 8, 2025 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants